package com.dwy2002.pojo.po.courses;

import com.dwy2002.pojo.po.base.BaseDeleted;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 课程报名表实体类
 *
 * @author 杜伟毅
 * @version 1.0
 * @since 2025/01/23
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class CourseEnrollments extends BaseDeleted {
    /**
     * 课程ID
     */
    private String courseId;

    /**
     * 用户ID
     */
    private String userId;

    /**
     * 报名时间，默认为当前时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8", shape = JsonFormat.Shape.STRING)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)        // 反序列化
    @JsonSerialize(using = LocalDateTimeSerializer.class)        // 序列化
    private LocalDateTime enrollmentTime;
}
